<template>
    <a-drawer placement="right" :closable="true" :title="title" :width="600" @close="handleCancel(false)"
              :visible="visible" :maskClosable="true"

    >


        <a-card class="margin-b-1rem" :bordered="true">


            <div class="padded10 " slot="cover">
                <img slot="cover" :src="license.imageUrl" width="100%"/>
            </div>
        </a-card>


        <a-descriptions bordered :column="1">


            <a-descriptions-item label="号牌号码">{{license.plateNo}}</a-descriptions-item>
            <a-descriptions-item label="车辆类型">{{license.vehicleType}}</a-descriptions-item>
            <a-descriptions-item label="所有人">
                {{license.owner}}
            </a-descriptions-item>
            <a-descriptions-item label="住址">
                {{license.address}}
            </a-descriptions-item>
            <a-descriptions-item label="使用性质">
                {{license.useCharacter}}
            </a-descriptions-item>
            <a-descriptions-item label="品牌型号">
                {{license.model}}
            </a-descriptions-item>
            <a-descriptions-item label="车辆识别代号">
                {{license.vin}}
            </a-descriptions-item>


            <a-descriptions-item label="发动机号码">
                {{license.engineNo}}
            </a-descriptions-item>

            <a-descriptions-item label="注册日期">
                {{license.registerDate}}
            </a-descriptions-item>

            <a-descriptions-item label="发证日期">
                {{license.issueDate}}
            </a-descriptions-item>


            <a-descriptions-item label="认证时间">
                {{license.createTime}}
            </a-descriptions-item>

        </a-descriptions>


    </a-drawer>
</template>
<script>

    import {vehicleLicenseFind} from '../public/http.js';

    export default {
        props: ['record'],
        data() {
            return {

                loading: false, //按钮Loading
                title: '认证信息查看',
                visible: true, //modal 显示状态
                VehicleTypeOPT: [],
                license: {}

            };
        },
        methods: {

            //关闭弹窗 刷新
            handleCancel(render = false) {
                this.visible = false;
                setTimeout(() => {
                    this.$emit('closeFun', {render: render})
                }, 500)

            },

            //数据初始化
            async init() {
                this.title = this.record.plateNo + "行驶证信息";
                await vehicleLicenseFind(this.record.plateNo).then(res => {
                    if (res.code === 0) {
                        this.license = res.data.result;
                    } else {
                        this.$exMod.ajaxMessage(res);
                    }
                })


            },


        },
        created() {

            this.init();
        }
    };
</script>
